package cn.itcast.com.Thread;

import java.io.InputStreamReader;

public class interupt {
    public static void main(String[] args) {
        InterThread interThread = new InterThread();
        interThread.start();

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        //终端线程的阻塞
        interThread.interrupt();
    }
}
class InterThread extends Thread{
    public void run(){
        System.out.println("begin");

        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            System.out.println("interpted");
        }
    }
}